﻿namespace Kent.Boogaart.Gauntlet
{
	/// <summary>
	/// Defines the functionality required of a regeneration policy, which is responsible for deciding whether a given generation
	/// operation should occur.
	/// </summary>
	/// <remarks>
	/// <para>
	/// Implementations of this interface are used prior to the generation process to determine whether the generation should even
	/// occur. Ideally, generation should only occur if necessary. If the generated output won't differ from the existing output, a
	/// generation policy should attempt to recognize this and skip the generation.
	/// </para>
	/// </remarks>
	public interface IRegenerationPolicy
	{
		/// <summary>
		/// Determines whether the generation should occur for a given context.
		/// </summary>
		/// <param name="context">
		/// The context.
		/// </param>
		/// <returns>
		/// <see langword="true"/> if the generation should take place, otherwise <see langword="false"/>.
		/// </returns>
		bool ShouldRegenerate(Context context);
	}
}